
var authorization = myStorage.getItem('memberidToken');
console.log(authorization);

var addrObj = JSON.parse(GetQueryString('addrObj'));

//获取商品详情

var goodsinfoParam = {
	goodsId:addrObj.goodsId
}
ltNetwork.tokenGet(configUrl.GOODSINFO_URL,goodsinfoParam,authorization,function(res){
	var data = res.data;
	console.log(data);
	$('#cartTmpl').tmpl(data).appendTo('#cartList');
	
	$('#goodsNum').text(addrObj.goodsNum);
	$('#categoryName').text(addrObj.categoryName);
	$('#specName').text(addrObj.specName);
	
	//商品金额
	var goodsPrice = addrObj.goodsNum * data.activityPrice;
	$('#goodsPrice').html(goodsPrice.toFixed(2));
	
},function(msg){
	console.log(msg);
});
//获取默认地址
ltNetwork.tokenGet(configUrl.ADDRESS_DEFAULT_URL,'',authorization,function(res){
	console.log(res);
	var data = res.data;
	$('#addressTmpl').tmpl(data).appendTo('.orderAddr');
	
	$('.orderAddr').on('click',function(){
		var href = $(this).attr('href');
		
		$(this).attr('href',href+'?addrObj='+JSON.stringify(addrObj));
	});
},function(msg){
	console.log(msg);
});

//我的优惠券列表
$('#couponList').on('click',function(){
	window.location.href = 'finance/coupon.html';
});
